	var popupDisable;
	var popupMain = {$popupMain};

{literal}
	function popupDisabled(popup, disabled)
	{
		popupDisable[popup] = disabled;
	}

	function popupOpenCenter(field_id, field_dsc, module, popup, popupW, popupH, sess)
	{
		if ( popupDisable[popup] != undefined )
					if ( popupDisable[popup] ) return;

		var popupO = ",scrollbars=no,status=no,location=no,resizable=no,toolbar=no,dependent";
        var posx = 0;
        var posy = 0;

		if (parseInt(navigator.appVersion) > 3) 
		{
			if (navigator.appName=="Netscape") 
			{
				winW = window.innerWidth;
				winH = window.innerHeight;
			}
			if ( navigator.appName.indexOf("Microsoft")!=-1 ) 
			{
				winW = document.body.offsetWidth;
				//winH = document.body.offsetHeight;
				winH = screen.availHeight;
			}
		}
	
		var posx = parseInt((winW - popupW) / 2);
		var posy = parseInt((winH - popupH) / 2) + 100;
	
		var url = popupMain + "?mod=" + module + " &do=" + popup;

		if ( sess != "" )	url += "&sessid=" + sess;

		url += "&field_id=" + field_id + "&field_dsc=" + field_dsc;

		url += "&field_id_value=" + document.forms[0].elements[field_id].value;
		url += "&field_dsc_value=" + document.forms[0].elements[field_dsc].value;

		window.open(url, popup, "top=" + posy + ",left=" + posx + ",width=" + popupW + ",height=" + popupH + popupO);
	}

	function popupOpen(field_id, field_dsc, module, popup, popupW, popupH, sess, e)
	{
		if ( popupDisable[popup] != undefined )
					if ( popupDisable[popup] ) return;

		var popupO = ",scrollbars=no,status=no,location=no,resizable=no,toolbar=no,dependent";
        var posx = 0;
        var posy = 0;

        if (!e) {
            var e = window.event;
        }

        if (e.pageX || e.pageY)	{
            posx = e.pageX;
            posy = e.pageY;
        } else if (e.clientX || e.clientY) {
            posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
            posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
        }

		var url = popupMain + "?mod=" + module + " &do=" + popup;

		if ( sess != "" )	url += "&sessid=" + sess;

		url += "&field_id=" + field_id + "&field_dsc=" + field_dsc;

		url += "&field_id_value=" + document.forms[0].elements[field_id].value;
		url += "&field_dsc_value=" + document.forms[0].elements[field_dsc].value;

		window.open(url, popup, "top=" + posy + ",left=" + posx + ",width=" + popupW + ",height=" + popupH + popupO);
	}
{/literal}

